package fr.perso.ppo.springintegration.error;

import org.springframework.integration.history.MessageHistory;

import com.google.common.base.Objects;

public class ErrorChannelMessage {

	private String message;
	private Object failedMessage;
	private MessageHistory messageHistory;
	private MessageHistory failedMessageHistory;

	public void setMessage(String message) {
		this.message = message;
	}

	public void setFailedMessage(Object payload) {
		this.failedMessage = payload;
	}

	public void setMessageHistory(MessageHistory messageHistory) {
		this.messageHistory = messageHistory;
	}

	public void setFailedMessageHistory(MessageHistory messageHistory2) {
		this.failedMessageHistory = messageHistory2;
	}

	public final String getMessage() {
		return message;
	}

	public final Object getFailedMessage() {
		return failedMessage;
	}

	public final MessageHistory getMessageHistory() {
		return messageHistory;
	}

	public final MessageHistory getFailedMessageHistory() {
		return failedMessageHistory;
	}

	@Override
	public String toString() {

		return Objects.toStringHelper(this).add("message", getMessage()).add("failedMessage", getFailedMessage()).add("messageHistory", getMessageHistory())
				.add("failedMessageHistory", getFailedMessageHistory()).toString();
	}

}
